package com.fqcar.fqdf.ui.chargemap.runnable;

import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.Overlay;
import com.fqcar.fqdf.entity.StubInfo;
import com.fqcar.fqdf.ui.chargemap.view.StubViewInterface;
import com.fqcar.fqdf.ui.main.marker.MainBaiduMarkerHelper;
import com.fqcar.fqdf.ui.main.runnable.BaiduRunnable;
import com.fqcar.fqdf.ui.main.view.MainViewInterface;

import java.util.List;

public class StubOverlayRunnable extends BaiduRunnable {

    private List<StubInfo> mData;

    private MyRunnableListener mListener;

    public StubOverlayRunnable(StubViewInterface mainView, BaiduMap baiduMap, List<StubInfo> data,
                               MainBaiduMarkerHelper helper, MyRunnableListener listener) {
        super(mainView, baiduMap, helper);
        mData = data;
        mListener =listener;
    }

    @Override
    public void run() {

        List<Overlay> carMarker = getMarkerHelper().createStubMarker(mData);
        if(mListener!=null){
            mListener.handleFinish(carMarker);
        }
    }
}
